<script type='text/javascript'>
jQuery(document).ready(function() {
    jQuery.ajax({
            type: 'POST',
            url: "<?php echo Mapper::url('/comentario/listar'); ?>",
            data: {
                    'lead_id': '<?php echo $objLead->lead_id; ?>'
            },
            success: function(r){
                    jQuery('#data-comentario').html(r);
            }
    });

    jQuery('#bt-novo-comentario').click(function(e) {
            e.preventDefault();

            jQuery.ajax({
                    type: 'POST',
                    url: "<?php echo Mapper::url('/comentario/criar'); ?>",
                    data: {
                            'lead_id': '<?php echo $objLead->lead_id; ?>'
                    },
                    success: function(resp){
                            jQuery('.modal').remove();
                            jQuery('#tabela-comentario').append(resp);
                    }
            });
    });

    jQuery('.detalhar-come').live('click',function(e) {
            e.preventDefault();

            jQuery.ajax({
                    type: 'POST',
                    url: "<?php echo Mapper::url('/comentario/detalhar'); ?>",
                    data: {
                            'come_id': jQuery(this).attr('come_id')
                    },
                    success: function(resp){
                            jQuery('.modal').remove();
                            jQuery('#tabela-comentario').append(resp);
                    }
            });
    });
});
</script>

<table id="tabela-comentario">
    <colgroup>
        <col width="25%" />
        <col />
        <col width="25%" />
    </colgroup>
    <thead>
        <tr>
            <th colspan="3">Comentários
            <a href="#" id="bt-novo-comentario" class="botaoCinza peq right">Novo comentário</a>
            </th>
        </tr>
    </thead>
    <tbody id="data-comentario"></tbody>
</table>